class Solution(object):
    def search(self, nums, target):
        """
        :type nums: List[int]
        :type target: int
        :rtype: int
        """
        l = -1 
        h = len(nums)
        while l != h - 1:
            mid = (h + l) / 2
            if nums[mid] == target:
                return mid
            
            if nums[mid] < target:
                l = mid
            else:
                h = mid
        return -1
